/*
 * Copyright (c) 2017, www.zm0618.com All Rights Reserved..
 */

package com.light.hessian.provider.slot;

import com.light.hessian.provider.config.ProviderInfo;
import com.light.hessian.provider.config.ProviderStatus;

/**
 * 服务提供者状态槽位
 * Created by zhaojun on 2017/02/11.
 */
public class ProviderStatusSlot {
    private String provider;
    private volatile SlotRuntime  runtime=new SlotRuntime();
    private volatile ProviderStatus status;
    private volatile boolean isShowBalancer;
    private ProviderInfo baseProviderInfo;

    public String getProvider() {
        return provider;
    }

    public void setProvider(String provider) {
        this.provider = provider;
    }

    public ProviderStatus getStatus() {
        return status;
    }

    public void setStatus(ProviderStatus status) {
        this.status = status;
    }

    public ProviderInfo getBaseProviderInfo() {
        return baseProviderInfo;
    }

    public void setBaseProviderInfo(ProviderInfo baseProviderInfo) {
        this.baseProviderInfo = baseProviderInfo;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ProviderStatusBaseSlot{");
        sb.append("provider='").append(provider).append('\'');
        sb.append(", status=").append(status);
        sb.append(", baseProviderInfo=").append(baseProviderInfo);
        sb.append('}');
        return sb.toString();
    }

    public SlotRuntime getRuntime() {
        return runtime;
    }

    public boolean isShowBalancer() {
        return isShowBalancer;
    }

    public void setShowBalancer(boolean showBalancer) {
        isShowBalancer = showBalancer;
    }

    public void setRuntime(SlotRuntime runtime) {
        this.runtime = runtime;
    }
}
